﻿using Shinkansen.Core;
using Shinkansen.Model;
using Shinkansen.Runtime;

namespace Shinkansen.Mvc
{
    public class QueryStringForImageBuilder : IQueryStringBuilder
    {
        private readonly IQueryStringBuilder _queryStringBuilder;

        /// <summary>
        /// Initializes a new instance of the <see cref="QueryStringForImageBuilder"/> class.
        /// </summary>
        /// <param name="builder">The query string builder.</param>
        public QueryStringForImageBuilder (IQueryStringBuilder builder)
        {
            _queryStringBuilder = builder;
        }

        /// <summary>
        /// Builds the specified query string.
        /// </summary>
        /// <param name="queryString">The query string.</param>
        public void ConstructQueryString (QueryString queryString)
        {
            _queryStringBuilder.ConstructQueryString (queryString);
            queryString[Tokens.FileType] = Tokens.Image;
        }
    }
}
